﻿using FlowCanvas;
using FlowCanvas.Nodes;
using LogSystem;
using ParadoxNotion.Design;
using Yoozoo.Gta.Common;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class ForceSetCityLOD : CallableActionNodeBase
    {
        protected override void OnRegisterPorts(FlowNode node)
        {
            var o = node.AddFlowOutput("Out");
            var p1 = node.AddValueInput<int>("lodLevel");
            
            node.AddFlowInput("In", (Flow f) => { Invoke(p1.value); o.Call(f); });
        }

        private void Invoke(int lodLevel)
        {
            Debug.LogFormat(LogModule.City, LogLevelType.Develop, "蓝图调用: ForceSetCityLOD {0}", lodLevel);
            ResidentHandler.Inst.GetFunction("CityLuaFunction.onLodChanged").Action(lodLevel);
        }
        
    }
}
